package com.jiang.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiang.bean.User;
import com.jiang.dao.UserDao;
import com.jiang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserDao, User> implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    public int getUserMessage(String username, String password) {
        return userDao.getUserMessage(username,password);
    }

    @Override
    public List<User> getAllUser(String username, int pageStart, int pageSize) {
        return userDao.getAllUser(username,pageStart,pageSize);
    }

    @Override
    public IPage<User> selectPage(Page<User> page) {
        return userDao.selectPage(page);
    }

    @Override
    public int getUserCounts(String username) {
        return userDao.getUserCounts(username);
    }

    @Override
    public int updateState(Integer id, Boolean state) {
        return userDao.updateState(id,state);
    }

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public User getUpdateUser(int id) {
        return userDao.getUpdateUser(id);
    }

    @Override
    public int editUser(User user) {
        return userDao.editUser(user);
    }

    @Override
    public int deleteUser(int id) {
        return userDao.deleteUser(id);
    }

    @Override
    public int selectcount(String username) {
        return userDao.selectcount(username);
    }


}
